package com.gusti.mensajes.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;

import com.gusti.mensajes.dao.IProjectDao;

/**
 * 
 * @author gusti
 *
 */
@Repository
public abstract class ProjectDao<EntityType> implements IProjectDao<EntityType> {

	@PersistenceContext
	protected EntityManager em;
	
	public EntityType save( EntityType entity ) {
		em.persist( entity );
		return entity;
	}
	
	public EntityType update( EntityType entity ) {
		em.merge( entity );
		return entity;
	}
	
}
